New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Chore: update blogpost template #12154
Conversation
@@ -14,7 +14,7 @@ const RULE_REGEX = new RegExp(`\`?\\b(${ruleList.join("|")})\\b\`?`, "g"); | |||
|
|||
function linkify(line) { | |||
return line | |||
.replace(/#(\d+)/g, "[#$1](https://github.com/eslint/eslint/issues/$1)") | |||
.replace(/([^\s/]+[/][^\s/]+)?#(\d+)/g, (_, repo, num) => `[${repo || ""}#${num}](https://github.com/${repo || "eslint/eslint"}/issues/${num})`) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry, it's tough to read those RegExp. Since the first group is optional, wouldn't repo
variable contain ticket number if repo is not present?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, repo
will be undefined
if repo is not present.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thanks!
Thanks for contributing to ESLint! |
What is the purpose of this pull request? (put an "X" next to item)
[X] Other, please explain: update the template to post blogs.
What changes did you make? (Give an overview)
This PR updates
templates/blogpost.md.ejs
to recognizeeslint/rfcs#123
-like links. This will prevent to make wrong links like:Is there anything you'd like reviewers to focus on?
Nothing in particular.